/*************************************************
Author: tony
Date: 10/27/2012
Description:
Notes: 
*************************************************/

#ifndef __cmdstorage_h__
#define __cmdstorage_h__

#include "../maindef.h"
#include "commclass.h"
#include "PBMsgHead.pb.h"
#include "MsgStorage.pb.h"

class CMainCtrl;

class CCmdGetUserStorageInfo : public CTAsyncCmd
{
public:
	enum REQ_STORAGE_KEY
	{
		 REQ_BAG_INFO = 1,            //请求背包信息
		 REQ_WAREHOUSE_INFO = 2,	  //请求仓库信息
	};
	
    virtual int Do(void* pData);
    virtual int AnsClients(int iRet);
    virtual int LogicDo(int iRet);

    CMainCtrl* pstMainCtrl;
    PBMsgHead  stMsgHead;
    CEnpNetHead stEnpHead;

    MsgReqUserStorageInfo stReq;    
    unsigned int _uiGID;
};

class CCmdSwapStoragePos : public CTAsyncCmd
{
public:
	virtual int Do(void* pData);
	virtual int AnsClients(int iRet);
	virtual int LogicDo(int iRet);

	CMainCtrl* pstMainCtrl;
	PBMsgHead  stMsgHead;
	CEnpNetHead stEnpHead;

	MsgReqSwapItemPos stReq;
	MsgAnsSwapItemPos stAns;
};

class CCmdMergBagToWare : public CTAsyncCmd
{
public:
	virtual int Do(void* pData);
	virtual int AnsClients(int iRet);
	virtual int LogicDo(int iRet);

	CMainCtrl* pstMainCtrl;
	PBMsgHead  stMsgHead;
	CEnpNetHead stEnpHead;

	MsgReqMergBagToWare stReq;
};

class CCmdSortStorage : public CTAsyncCmd
{
public:
	virtual int Do(void* pData);
	virtual int AnsClients(int iRet);
	virtual int LogicDo(int iRet);

	CMainCtrl* pstMainCtrl;
	PBMsgHead  stMsgHead;
	CEnpNetHead stEnpHead;

	MsgReqSortStorage stReq;
};

class CCmdPickUpItem : public CTAsyncCmd
{
public:
	virtual int Do(void* pData);
	virtual int AnsClients(int iRet);
	virtual int LogicDo(int iRet);

	CMainCtrl* pstMainCtrl;
	PBMsgHead  stMsgHead;
	CEnpNetHead stEnpHead;

    MsgReqPickUpItem stReq;
    MsgAnsUserStorageInfo stGroudAns;
    MsgAnsUserStorageInfo stBagAns;

    MsgAnsPickUpItem stAns;
};

class CCmdDiscardItem : public CTAsyncCmd
{
public:	
    virtual int Do(void* pData);
    virtual int AnsClients(int iRet);
    virtual int LogicDo(int iRet);

    CMainCtrl* pstMainCtrl;
    PBMsgHead  stMsgHead;
    CEnpNetHead stEnpHead;

	MsgReqDiscardItem stReq;
	MsgAnsDiscardItem stAns;
};

class CCmdUnlockGrid : public CTAsyncCmd
{
public:	
    virtual int Do(void* pData);
    virtual int AnsClients(int iRet);
    virtual int LogicDo(int iRet);

    CMainCtrl* pstMainCtrl;
    PBMsgHead  stMsgHead;
    CEnpNetHead stEnpHead;

    MsgReqUnlockGrid stReq;
    unsigned int _uiGID;
};

class CCmdBagOpt : public CTAsyncCmd
{
public:	
    virtual int Do(void* pData);
    virtual int AnsClients(int iRet);
    virtual int LogicDo(int iRet);

    CMainCtrl* pstMainCtrl;
    PBMsgHead  stMsgHead;
    CEnpNetHead stEnpHead;

    MsgReqBagOpt stReq;
    MsgAnsBagOpt stAns;

    unsigned int _uiGID;
};

class CCmdActStorage : public CTAsyncCmd
{
public:
    virtual int Do(void* pData);
    virtual int AnsClients(int iRet);
    virtual int LogicDo(int iRet);

    CMainCtrl* pstMainCtrl;
    PBMsgHead  stMsgHead;
    CEnpNetHead stEnpHead;

    MsgReqActStorage stReq;
    MsgAnsActStorage stAns;

	int iSubCmd;
    unsigned int uiGID;
};

#endif // __cmdstorage_h__


